<template>
    <div class="zc-layout-header-brand">
        <a href="">
            <div class="zc-company-avtar">{{ company.avatar }}</div>
        </a>
        <a href="">
            <div class="zc-company-title">{{ company.name }}</div>
        </a>
    </div>
    <div class="zc-layout-header-bar">
        <Env></Env>
        <Avatar></Avatar>
    </div>
</template>
<script setup type="ts">
import Avatar from "@/views/layouts/core/avatar.vue";
import Env from "@/views/comps/dictionary/env.vue";
import {CompanyStore} from '@/stores/company'
import {onBeforeMount} from "vue";
import router from "@/router";
import {storeToRefs} from "pinia";

const store = CompanyStore();
const {company} = storeToRefs(store);
onBeforeMount(() => {
    if (!company.value.id) {
        store.doLoadCompany(router.currentRoute.value.params.companyId);
    }
})

</script>
